
var $ = require('jquery');
var inboundChart = require('./inboundChart.js');
var dayChart = require("./dayChart.js");
var storeRationChart = require("./storeRation.js")

$(function () {
function makeChart(){
	var  colorList = [
		"#00c5d2",
		"#ef98d0",
		"#802bff",
		"#54c6af",
		"#edcd61",
		"#0081fa",
		"#73e3f8",
		"#ffd473",
		"#1c3a9f",
		"#421b9f",
		"#16889d"
	];
	var xAxisData = [];
	var data1 = [];
	var data2 = [];
	var data3 = [];


	for (var i = 0; i < 12; i++) {
		xAxisData.push(  i+1+"月");
		data1.push((Math.random() * 3000).toFixed(2));
		data2.push((Math.random() * 2000).toFixed(2));
		data3.push((Math.random() * 1000).toFixed(2));
		
	}

//出入库表
	inboundChart.init($("#inboundChart"),xAxisData,data1,data2,data3);


	
	
	
//运行天数曲线图
	dayChart.init($("#dayChart"),xAxisData,data1,"43,102,240");

	//storeRation
//仓储数据环形柱状图
	storeRationChart.init($("#storeRation"));


//KPI曲线图

	var KPIChart = require("./KPIChart.js");
	KPIChart.init($("#KPIChart"));

}
makeChart()

$(window).resize(function(){
	makeChart()
})

// //KPI曲线图下各个进度条颜色，及宽度
// 	$(".progress-bar-active").map(function(i){

// 		var widthValue = Math.random()*100+"%";
// 		// console.log
// 		$(".progress-bar-active").eq(i).css({
// 			background:colorList[i],
// 			width:widthValue 
			
// 		})
// 	})
})